# Zope imports
from AccessControl import ClassSecurityInfo

# zope imports
from zope.interface import implements

# Archetypes imports
from Products.Archetypes.atapi import *
from Products.ATContentTypes.content.folder import ATFolder

# ATReferenceBrowserWidget imports
from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import ReferenceBrowserWidget

# iqpp.plone.simpleimagemapping imports
from iqpp.plone.simpleimagemapping.config import PROJECTNAME
from iqpp.plone.simpleimagemapping.interfaces import IMappedFolder

schema = Schema((
    BooleanField(
        name = "inheritImages",
        languageIndependent=True,
        default=True,
        widget = BooleanWidget(
            label="Inherit Images",
            label_msgid="schema_inherit_images_label",
            description = "If selected images of the parent folder are inherited",  
            description_msgid="schema_inherit_images_description",
            i18n_domain="iqpp.plone.simpleimagemapping",
        ),
    ),
    
),
)

schema = ATFolder.schema.copy() + schema

class MappedFolder(ATFolder):
    """
    """
    implements(IMappedFolder)
    security = ClassSecurityInfo()
    _at_rename_after_creation = True
    schema = schema
        
registerType(MappedFolder, PROJECTNAME)